package com.zdhy.zoc.commen.util;

import org.apache.log4j.Logger;

import java.util.ResourceBundle;

/**
 * Created by 梁浩峰 on 2016/8/24 16:38.
 */
public class SystemConfig {
    private static final Logger logger = Logger.getLogger(SystemConfig.class);

    static String configFile = "snmpCollect";
    public static String getConfigInfomation(String itemIndex) {
        try {
            ResourceBundle resource = ResourceBundle.getBundle(configFile);
            return resource.getString(itemIndex);
        } catch (Exception e) {
            return "";
        }
    }

    public static String getConfigInfomation(String finename,String itemIndex) {
        try {
            ResourceBundle resource = ResourceBundle.getBundle(finename);
            return resource.getString(itemIndex);
        } catch (Exception e) {
            return "";
        }
    }

    public static void main(String arg[])
    {
        logger.info(SystemConfig.getConfigInfomation("DATABASE_PASSWORD"));
    }
}
